package main;

import io.GeneFileReader;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

import util.Translator;

import util.WordsInRandomSequencesCalculator;

public class WordsInRandomSequencesMain {
	private static Translator tr = new Translator();
	private static WordsInRandomSequencesCalculator calculator=new WordsInRandomSequencesCalculator();
	public static void main(String[] args) throws FileNotFoundException,
			IOException {
		//Aquifex aeolicus.ffn 1
		//Archaeoglobus fulgidus.ffn 2
		//Bacillus subtilis.ffn 3
		//Bacteroides thetaiotaomicron.ffn 4
		//Chlamydia muridarum.ffn 5
		//Dehalococcoides ethenogenes.ffn 6
		//Escherichia coli.ffn 7
		//Fusobacterium nucleatum.ffn 8
		//Gloeobacter violaceus.ffn 9
		//Leptospira interrogans.ffn 10
		//Nanoarchaeum equitans.ffn 11
		//Pirellula.ffn 12
		//Rubrobacter xylanophilus.ffn 13
		//Sulfolobus acidocaldarius.ffn 14
		//Thermotoga maritima.ffn 15
		//Thermus thermophilus.ffn 16
		//16_organisms.ffn

		String organism = "16_organisms.ffn";
		GeneFileReader fr = new GeneFileReader(new FileInputStream(new File(
				"organisms/" + organism)));
		for (int i=0;i<fr.numberOfGenes();i++){
			calculator.addSequenceUpdate(tr.tripletTranslate(fr.getGeneAt(i)));
			if (i%100==0){
				System.out.println(i);
			}
		}

		System.out.println("-------------------------------");
		calculator.printWords();
	}
}
